<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/admin/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>内容分类列表</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link rel="stylesheet" type="text/css" href="../css/backCss.css">
<link rel="stylesheet" type="text/css" href="../css/list.css">

<script type="text/javascript">
	 
	//首页
	function topPage() {
		if(document.getElementById("currentPage").value==1){ 
			return;
		}
		with (document.getElementById("PaperContentTypeform")) {
			document.getElementById("currentPage").value = 1  ; 
			action="listByWherePagePaperContentType.action";
			method="post";
			submit();
		} 
	}
	//前一页
	function previousPage() {
		if(document.getElementById("currentPage").value==1){ 
			return;
		}
		with (document.getElementById("PaperContentTypeform")) {
			document.getElementById("currentPage").value = ${page.currentPage-1}  ; 
			action="listByWherePagePaperContentType.action";
			method="post";
			submit();
		}  
	}	
	//后一页
	function nextPage() {
		var totalPage = ${page.totalPage};
		if(document.getElementById("currentPage").value==totalPage ){  
			return;
		}
		with (document.getElementById("PaperContentTypeform")) {
			document.getElementById("currentPage").value = ${page.currentPage+1}  ; 
			action="listByWherePagePaperContentType.action";
			method="post";
			submit();
		}  
	}
	//最后一页
	function bottomPage() {
		var totalPage = ${page.totalPage};
		if(document.getElementById("currentPage").value== totalPage ){  
			return;
		}
		with (document.getElementById("PaperContentTypeform")) {
			document.getElementById("currentPage").value =  ${page.totalPage}  ; 
			action="listByWherePagePaperContentType.action";
			method="post";
			submit();
		}   
	}
	//修改每页显示的数量
	 function changEveryPage(){ 
			with (document.getElementById("PaperContentTypeform")) {
			//	document.getElementById("currentPage").value =  1 ;   
				action="listByWherePagePaperContentType.action";
				method="post";
				submit();
			}  
	 }

	function listByWhere(){
		with (document.getElementById("PaperContentTypeform")) {
			document.getElementById("currentPage").value =  1 ;  
			action="listByWherePagePaperContentType.action";
			method="post";
			submit();
		}  
	}
	
	function checkedType(line){  
		var contentId = document.pctform;
		var doc = window.opener.document; 
		doc.getElementById("contentId").value=line.cells[3].innerHTML;
		doc.getElementById("contentName").value=line.cells[1].innerHTML;
		window.close();
	}
</script>

</head>

<body>
	<div class="top">
		<jsp:include page="top.jsp"></jsp:include>
	</div>

	<div class="content" align="center">
		<div>
			<s:if
				test="#request.parentPaperContentType!=null && #request.parentPaperContentType.name!=null">
				 当前位置： <a title="考试类型管理" href="selectByPageContentType.action" target="_self">内容类型</a>&nbsp;&gt;
				<a title="${parentPaperContentType.name }"
					href="<%=basePath%>selectByIdContentType.action?id=${parentPaperContentType.id }">${parentPaperContentType.name
					}</a>&nbsp;&gt; <span>${paperContentType.name }</span>
			</s:if>
			<s:else> 
				当前位置： <a title="考试类型管理" href="selectContentType.action" target="_self">内容类型</a>&nbsp;&gt;
				<span>${paperContentType.name }</span>
			</s:else>
		</div>
		<div class="main" align="center">
			<h3>选择内容分类</h3>
			<div class="sort_c">
				<form action="listByWherePagePaperContentType.action" id="pctform"
					name="pctform" method="post">
					<s:if
						test="#request.paperContentType.paperContentTypeList == null || #request.paperContentType.paperContentTypeList.size() == 0">
						<div align="center">
							<font color="red"><b>没有查询到内容分类的相关数据信息</b> </font> &nbsp;&nbsp; 
						</div>
					</s:if>
					<s:else>
						<div align="center" style="padding-top: 5">
							<table cellspacing="0" cellpadding="0" border="1" width="80%"
								style="border-collapse: collapse;" bordercolor="black">
								<tr height="25" class="trth" style="background-color: #92AED7;">
									<th width="60" >序号</th>
									<th width="200">名称</th>
									<th width="200">备注</th>
									<th width="45">ID号</th>
									<th width="200">父类型</th>
									<th width="100">操作</th>
								</tr>
								<s:iterator id="pct"
									value="#request.paperContentType.paperContentTypeList" status="stu">
									<tr align="center" height="25" class="trtd" id="trtd" >
										<td>${stu.count }</td>
										<td>${pct.name }</td>
										<td>${pct.remark }</td>
										<td>${pct.id }</td>
										<td>${paperContentType.name }</td>
										<td><a
											href="selectByIdContentType.action?id=${pct.id }"
											style="text-decoration: none; color: #0F3763;">查看</a>  
											<input type="button" value="选中" style="background: #BBE5FF;" onclick="checkedType(this.parentNode.parentNode)"/>
										</td>
									</tr>
								</s:iterator>
							</table>
						</div>
					</s:else>
					<div align="center" style="padding-top: 5;">
						当前第 <font color="red">${page.currentPage}/${page.totalPage
							}</font>页&nbsp; 共 <font color="red">${page.totalPage}</font>页 每页 <font
							color="red">${page.everyPage }</font>条

						<s:if test="#request.page.hasPrePage">
							<input type="button" name="btnTopPage" id="btnTopPage"
								value="|&lt;&lt; " title="首页" onClick="topPage()">
							<input type="button" name="btnPreviousPage" id="btnPreviousPage"
								value=" &lt;  " title="上页" onClick="previousPage()">

						</s:if>
						<s:else>
							<input type="button" name="btnTopPage" id="btnTopPage"
								value="|&lt;&lt; " title="首页" onClick="topPage()"
								disabled="disabled">
							<input type="button" name="btnPreviousPage" id="btnPreviousPage"
								value=" &lt;  " title="上页" onClick="previousPage()"
								disabled="disabled">
						</s:else>
						<s:if test="#request.page.hasNextPage">
							<input type="button" name="btnNextPage" id="btnNextPage"
								value="  &gt; " title="下页" onClick="nextPage()">
							<input type="button" name="btnBottomPage" id="btnBottomPage"
								value=" &gt;&gt;|" title="尾页" onClick="bottomPage()">
						</s:if>
						<s:else>
							<input type="button" name="btnNextPage" id="btnNextPage"
								value="  &gt; " title="下页" onClick="nextPage()"
								disabled="disabled">
							<input type="button" name="btnBottomPage" id="btnBottomPage"
								value=" &gt;&gt;|" title="尾页" onClick="bottomPage()"
								disabled="disabled">
						</s:else>
						 <input type="hidden"
							name="page.currentPage" id="currentPage"
							value="${page.currentPage}">
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="foot" align="center">
		<jsp:include page="foot.jsp"></jsp:include>
	</div>
</body>
</html>
